package com.nulldev.util.java.swing;

import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;

import com.nulldev.util.image.ImageUtil;
import com.nulldev.util.java.swing.extSwing.lookandfeel.themes.Theme;
import com.nulldev.util.java.swing.extSwing.lookandfeel.themes.ThemeApplier;
import com.nulldev.util.logging.LoggerFactory;

import javax.imageio.ImageIO;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JLabel;
import javax.swing.LayoutStyle.ComponentPlacement;
import javax.swing.SwingConstants;
import javax.swing.ImageIcon;

@Deprecated
public class nullUtilAbout extends JFrame {

	private JPanel contentPane;

	/**
	 * Launch the application.
	 */
	@Deprecated
	public static void main() {
		LoggerFactory.getLogger().warn("main() -> This is deprecated! Use nullUtilAbout2.class!");
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					nullUtilAbout frame = new nullUtilAbout();
					ThemeApplier.applyTheme(Theme.FAIR_GREY, frame);
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	@Deprecated
	public nullUtilAbout() throws Exception {
		LoggerFactory.getLogger().warn("Class.Constructor() -> This is deprecated! Use nullUtilAbout2.class!");
		//UIManager.setLookAndFeel("com.nulldev.util.java.swing.extSwing.lookandfeel.DarkLookAndFeel");
		setTitle("About");
		setResizable(false);
		setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
		setBounds(100, 100, 214, 253);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		
		JLabel label = new JLabel("");
		label.setHorizontalAlignment(SwingConstants.CENTER);
		label.setIcon(new ImageIcon(ImageUtil.scale(ImageIO.read(nullUtilAbout.class.getResource("/com/nulldev/util/java/swing/nu_logo.png")), 32, 32)));
		
		JLabel lblNullutil = new JLabel("nullUtil 2");
		lblNullutil.setHorizontalAlignment(SwingConstants.CENTER);
		
		JLabel lblPoweredBy = new JLabel("powered by:");
		
		JLabel lblIwebkit = new JLabel("iWebKit");
		
		JLabel lblEswing = new JLabel("eSwing");
		
		JLabel lblFnet = new JLabel("fNet");
		
		JLabel lblNyt = new JLabel("nYT");
		
		JLabel lblGutil = new JLabel("gUtil");
		GroupLayout gl_contentPane = new GroupLayout(contentPane);
		gl_contentPane.setHorizontalGroup(
			gl_contentPane.createParallelGroup(Alignment.TRAILING)
				.addGroup(gl_contentPane.createSequentialGroup()
					.addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING)
						.addGroup(Alignment.TRAILING, gl_contentPane.createParallelGroup(Alignment.TRAILING)
							.addGroup(gl_contentPane.createSequentialGroup()
								.addContainerGap()
								.addComponent(label, GroupLayout.DEFAULT_SIZE, 192, Short.MAX_VALUE))
							.addComponent(lblNullutil, GroupLayout.PREFERRED_SIZE, 204, GroupLayout.PREFERRED_SIZE))
						.addGroup(gl_contentPane.createSequentialGroup()
							.addContainerGap()
							.addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING)
								.addComponent(lblPoweredBy)
								.addGroup(gl_contentPane.createSequentialGroup()
									.addGap(12)
									.addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING)
										.addComponent(lblEswing)
										.addComponent(lblIwebkit)
										.addComponent(lblFnet)
										.addComponent(lblNyt)
										.addComponent(lblGutil))))))
					.addContainerGap())
		);
		gl_contentPane.setVerticalGroup(
			gl_contentPane.createParallelGroup(Alignment.LEADING)
				.addGroup(gl_contentPane.createSequentialGroup()
					.addGap(20)
					.addComponent(label, GroupLayout.PREFERRED_SIZE, 21, GroupLayout.PREFERRED_SIZE)
					.addPreferredGap(ComponentPlacement.UNRELATED)
					.addComponent(lblNullutil)
					.addGap(18)
					.addComponent(lblPoweredBy)
					.addPreferredGap(ComponentPlacement.RELATED)
					.addComponent(lblIwebkit)
					.addPreferredGap(ComponentPlacement.RELATED)
					.addComponent(lblEswing)
					.addPreferredGap(ComponentPlacement.RELATED)
					.addComponent(lblFnet)
					.addPreferredGap(ComponentPlacement.RELATED)
					.addComponent(lblNyt)
					.addPreferredGap(ComponentPlacement.RELATED)
					.addComponent(lblGutil)
					.addContainerGap(17, Short.MAX_VALUE))
		);
		contentPane.setLayout(gl_contentPane);
	}
}
